#!/bin/bash
usage() {
    echo -e "Usage :  $0 [env]"
    echo -e "    where [env] can be:"
    echo -e "\t  - qa"
    echo -e "\t  - staging"
    echo -e "\t  - prod"
    exit 1
    
}

if [ $# -ne 1 ];then
   usage
fi

env=''
case $1 in
    qa|staging|prod)
    env=$1
    ;;
    *)
    usage
    ;;
esac

echo "deliver war file..."
ansible-playbook -i inventories/${env}/hosts.ini deliver_war.yml
echo ""
echo "deliver finished."
